package com.feisi.service.impl;

import com.feisi.dao.ActivityDao;
import com.feisi.domain.Activity;
import com.feisi.service.ActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service("activityService")
public class ActivityServiceImpl implements ActivityService {
    @Autowired
    private ActivityDao activityDao;

    @Override
    public List<Activity> findAll(Integer page, Integer limit) {
        List<Activity> activities = activityDao.findAll(page, limit);
        return activities;
    }

    @Override
    public Integer activityTotal() {
        Integer activityTotal = activityDao.activityTotal();
        return activityTotal;
    }

    @Override
    public List<Activity> findByName(String ac_name, Integer page, Integer limit) {
        List<Activity> activities = activityDao.findByName(ac_name, page, limit);
        return activities;
    }

    @Override
    public Integer activityTotalByName(String ac_name) {
        Integer activityTotalByName = activityDao.activityTotalByName(ac_name);
        return activityTotalByName;
    }

    @Override
    public void saveActivity(Activity activity) {
        activityDao.saveActivity(activity);
    }

    @Override
    public void deleteActivity(Integer[] ids) {
        activityDao.deleteActivity(ids);
    }
/*
    @Override
    public void deleteUser(Integer[] ids) {
        userDao.deleteUser(ids);
    }*/
    @Override
    public void updateActivity(Activity activity) {
        activityDao.updateActivity(activity);
    }
}
